<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>fdk-aac: original/libSBRenc/src/ton_corr.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">fdk-aac
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ed137715e08969a186ec660e8ae6e2fb.html">original</a></li><li class="navelem"><a class="el" href="dir_ed04b364c633b7d989cbbfdbe7d82d9c.html">libSBRenc</a></li><li class="navelem"><a class="el" href="dir_503efe22260b46e9073f09b8bee50978.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ton_corr.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>General tonality correction detector module.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;sbr_encoder.h&quot;</code><br />
<code>#include &quot;<a class="el" href="mh__det_8h_source.html">mh_det.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="nf__est_8h_source.html">nf_est.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="invf__est_8h_source.html">invf_est.h</a>&quot;</code><br />
</div>
<p><a href="ton__corr_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_a_t_c_h___p_a_r_a_m.html">PATCH_PARAM</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">SBR_TON_CORR_EST</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7e10617071cac705731ed0a77e7865a6"><td class="memItemLeft" align="right" valign="top"><a id="a7e10617071cac705731ed0a77e7865a6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_NUM_PATCHES</b>&#160;&#160;&#160;6</td></tr>
<tr class="separator:a7e10617071cac705731ed0a77e7865a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2e8c160a9917b20abc1547be796f33a"><td class="memItemLeft" align="right" valign="top"><a id="ae2e8c160a9917b20abc1547be796f33a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SCALE_NRGVEC</b>&#160;&#160;&#160;4</td></tr>
<tr class="separator:ae2e8c160a9917b20abc1547be796f33a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a9713272fbfb38934ce1e9c6c05844742"><td class="memItemLeft" align="right" valign="top"><a id="a9713272fbfb38934ce1e9c6c05844742"></a>
typedef <a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">SBR_TON_CORR_EST</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>HANDLE_SBR_TON_CORR_EST</b></td></tr>
<tr class="separator:a9713272fbfb38934ce1e9c6c05844742"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a443b6abc5370d1fee3e5941d5b25659e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#a443b6abc5370d1fee3e5941d5b25659e">FDKsbrEnc_TonCorrParamExtr</a> (<a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr, INVF_MODE *infVec, FIXP_DBL *noiseLevels, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *missingHarmonicFlag, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *missingHarmonicsIndex, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *envelopeCompensation, const <a class="el" href="struct_s_b_r___f_r_a_m_e___i_n_f_o.html">SBR_FRAME_INFO</a> *frameInfo, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *transientInfo, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *freqBandTable, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> nSfb, XPOS_MODE xposType, <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> sbrSyntaxFlags)</td></tr>
<tr class="memdesc:a443b6abc5370d1fee3e5941d5b25659e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts the parameters required in the decoder to obtain the correct tonal to noise ratio after SBR.  <a href="ton__corr_8h.html#a443b6abc5370d1fee3e5941d5b25659e">More...</a><br /></td></tr>
<tr class="separator:a443b6abc5370d1fee3e5941d5b25659e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d3573ce144bc6e824bf521b12e0af34"><td class="memItemLeft" align="right" valign="top"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#a9d3573ce144bc6e824bf521b12e0af34">FDKsbrEnc_CreateTonCorrParamExtr</a> (<a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> chan)</td></tr>
<tr class="memdesc:a9d3573ce144bc6e824bf521b12e0af34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an instance of the tonality correction parameter module.  <a href="ton__corr_8h.html#a9d3573ce144bc6e824bf521b12e0af34">More...</a><br /></td></tr>
<tr class="separator:a9d3573ce144bc6e824bf521b12e0af34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b767c9b0f3713d01d36a1810679736a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#a3b767c9b0f3713d01d36a1810679736a">FDKsbrEnc_InitTonCorrParamExtr</a> (<a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> frameSize, <a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr, <a class="el" href="struct_s_b_r___c_o_n_f_i_g___d_a_t_a.html">HANDLE_SBR_CONFIG_DATA</a> sbrCfg, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> timeSlots, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> xposCtrl, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> ana_max_level, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> noiseBands, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> noiseFloorOffset, <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> useSpeechConfig)</td></tr>
<tr class="memdesc:a3b767c9b0f3713d01d36a1810679736a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize an instance of the tonality correction parameter module.  <a href="ton__corr_8h.html#a3b767c9b0f3713d01d36a1810679736a">More...</a><br /></td></tr>
<tr class="separator:a3b767c9b0f3713d01d36a1810679736a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2acfd3b4fb6d527747be5eb1952b2c54"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#a2acfd3b4fb6d527747be5eb1952b2c54">FDKsbrEnc_DeleteTonCorrParamExtr</a> (<a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr)</td></tr>
<tr class="memdesc:a2acfd3b4fb6d527747be5eb1952b2c54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes the tonality correction paramtere module.  <a href="ton__corr_8h.html#a2acfd3b4fb6d527747be5eb1952b2c54">More...</a><br /></td></tr>
<tr class="separator:a2acfd3b4fb6d527747be5eb1952b2c54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab706294b3bfbda700a1598ccd83f8229"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#ab706294b3bfbda700a1598ccd83f8229">FDKsbrEnc_CalculateTonalityQuotas</a> (<a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr, FIXP_DBL **sourceBufferReal, FIXP_DBL **sourceBufferImag, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> usb, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> qmfScale)</td></tr>
<tr class="separator:ab706294b3bfbda700a1598ccd83f8229"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a814807f60ae3e6da8e90cf55cc7bc827"><td class="memItemLeft" align="right" valign="top"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ton__corr_8h.html#a814807f60ae3e6da8e90cf55cc7bc827">FDKsbrEnc_ResetTonCorrParamExtr</a> (<a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a> hTonCorr, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> xposctrl, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> highBandStartSb, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *v_k_master, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> numMaster, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> fs, <a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> **freqBandTable, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *nSfb, <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> noQmfChannels)</td></tr>
<tr class="memdesc:a814807f60ae3e6da8e90cf55cc7bc827"><td class="mdescLeft">&#160;</td><td class="mdescRight">resets tonality correction parameter module.  <a href="ton__corr_8h.html#a814807f60ae3e6da8e90cf55cc7bc827">More...</a><br /></td></tr>
<tr class="separator:a814807f60ae3e6da8e90cf55cc7bc827"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>General tonality correction detector module. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ab706294b3bfbda700a1598ccd83f8229"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab706294b3bfbda700a1598ccd83f8229">&#9670;&nbsp;</a></span>FDKsbrEnc_CalculateTonalityQuotas()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FDKsbrEnc_CalculateTonalityQuotas </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL **&#160;</td>
          <td class="paramname"><em>sourceBufferReal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL **&#160;</td>
          <td class="paramname"><em>sourceBufferImag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>usb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>qmfScale</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">qmfScale</td><td>sclefactor of QMF subsamples </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9d3573ce144bc6e824bf521b12e0af34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d3573ce144bc6e824bf521b12e0af34">&#9670;&nbsp;</a></span>FDKsbrEnc_CreateTonCorrParamExtr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> FDKsbrEnc_CreateTonCorrParamExtr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>chan</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates an instance of the tonality correction parameter module. </p>
<p>Channel index, needed for mem allocation</p>
<p>The module includes modules for inverse filtering level estimation, missing harmonics detection and noise floor level estimation.</p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, noError if successful. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hTonCorr</td><td>Pointer to handle to SBR_TON_CORR struct. </td></tr>
    <tr><td class="paramname">chan</td><td>Channel index, needed for mem allocation </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2acfd3b4fb6d527747be5eb1952b2c54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2acfd3b4fb6d527747be5eb1952b2c54">&#9670;&nbsp;</a></span>FDKsbrEnc_DeleteTonCorrParamExtr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FDKsbrEnc_DeleteTonCorrParamExtr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes the tonality correction paramtere module. </p>
<p>Handle to SBR_TON_CORR struct.</p>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hTonCorr</td><td>Handle to SBR_TON_CORR struct. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3b767c9b0f3713d01d36a1810679736a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b767c9b0f3713d01d36a1810679736a">&#9670;&nbsp;</a></span>FDKsbrEnc_InitTonCorrParamExtr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> FDKsbrEnc_InitTonCorrParamExtr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>frameSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___c_o_n_f_i_g___d_a_t_a.html">HANDLE_SBR_CONFIG_DATA</a>&#160;</td>
          <td class="paramname"><em>sbrCfg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>timeSlots</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>xposCtrl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>ana_max_level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>noiseBands</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>noiseFloorOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>useSpeechConfig</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize an instance of the tonality correction parameter module. </p>
<p>The module includes modules for inverse filtering level estimation, missing harmonics detection and noise floor level estimation.</p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, noError if successful. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">frameSize</td><td>Current SBR frame size. </td></tr>
    <tr><td class="paramname">hTonCorr</td><td>Pointer to handle to SBR_TON_CORR struct. </td></tr>
    <tr><td class="paramname">sbrCfg</td><td>Pointer to SBR configuration parameters. </td></tr>
    <tr><td class="paramname">timeSlots</td><td>Number of time-slots per frame </td></tr>
    <tr><td class="paramname">xposCtrl</td><td>Different patch modes. </td></tr>
    <tr><td class="paramname">ana_max_level</td><td>Maximum level of the adaptive noise. </td></tr>
    <tr><td class="paramname">noiseBands</td><td>Number of noise bands per octave. </td></tr>
    <tr><td class="paramname">noiseFloorOffset</td><td>Noise floor offset. </td></tr>
    <tr><td class="paramname">useSpeechConfig</td><td>Speech or music tuning. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a814807f60ae3e6da8e90cf55cc7bc827"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a814807f60ae3e6da8e90cf55cc7bc827">&#9670;&nbsp;</a></span>FDKsbrEnc_ResetTonCorrParamExtr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> FDKsbrEnc_ResetTonCorrParamExtr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>xposctrl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>highBandStartSb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *&#160;</td>
          <td class="paramname"><em>v_k_master</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>numMaster</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>fs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> **&#160;</td>
          <td class="paramname"><em>freqBandTable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *&#160;</td>
          <td class="paramname"><em>nSfb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>noQmfChannels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>resets tonality correction parameter module. </p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, noError if successful. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hTonCorr</td><td>Handle to SBR_TON_CORR struct. </td></tr>
    <tr><td class="paramname">xposctrl</td><td>Different patch modes. </td></tr>
    <tr><td class="paramname">highBandStartSb</td><td>Start band of the SBR range. </td></tr>
    <tr><td class="paramname">v_k_master</td><td>Master frequency table from which all other table are derived. </td></tr>
    <tr><td class="paramname">numMaster</td><td>Number of elements in the master table. </td></tr>
    <tr><td class="paramname">fs</td><td>Sampling frequency (of the SBR part). </td></tr>
    <tr><td class="paramname">freqBandTable</td><td>Frequency band table for low-res and high-res. </td></tr>
    <tr><td class="paramname">nSfb</td><td>Number of frequency bands (hig-res and low-res). </td></tr>
    <tr><td class="paramname">noQmfChannels</td><td>Number of QMF channels. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a443b6abc5370d1fee3e5941d5b25659e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a443b6abc5370d1fee3e5941d5b25659e">&#9670;&nbsp;</a></span>FDKsbrEnc_TonCorrParamExtr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void FDKsbrEnc_TonCorrParamExtr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___t_o_n___c_o_r_r___e_s_t.html">HANDLE_SBR_TON_CORR_EST</a>&#160;</td>
          <td class="paramname"><em>hTonCorr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">INVF_MODE *&#160;</td>
          <td class="paramname"><em>infVec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FIXP_DBL *&#160;</td>
          <td class="paramname"><em>noiseLevels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> *&#160;</td>
          <td class="paramname"><em>missingHarmonicFlag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *&#160;</td>
          <td class="paramname"><em>missingHarmonicsIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *&#160;</td>
          <td class="paramname"><em>envelopeCompensation</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="struct_s_b_r___f_r_a_m_e___i_n_f_o.html">SBR_FRAME_INFO</a> *&#160;</td>
          <td class="paramname"><em>frameInfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *&#160;</td>
          <td class="paramname"><em>transientInfo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#aed5a2dbe32af3a91203f0f5e8697e873">UCHAR</a> *&#160;</td>
          <td class="paramname"><em>freqBandTable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>nSfb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XPOS_MODE&#160;</td>
          <td class="paramname"><em>xposType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>sbrSyntaxFlags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extracts the parameters required in the decoder to obtain the correct tonal to noise ratio after SBR. </p>
<p>Estimates the tonal to noise ratio of the original signal (using LPC). Predicts the tonal to noise ration of the SBR signal (in the decoder) by patching the tonal to noise ratio values similar to the patching of the lowband in the decoder. Given the tonal to noise ratio of the original and the SBR signal, it estimates the required amount of inverse filtering, additional noise as well as any additional sines.</p>
<dl class="section return"><dt>Returns</dt><dd>none. </dd></dl>
<p>&lt; Flag indicating if a transient is present in the current frame.</p>
<p>&lt; Position of the transient.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hTonCorr</td><td>Handle to SBR_TON_CORR struct. </td></tr>
    <tr><td class="paramname">infVec</td><td>Vector where the inverse filtering levels will be stored. </td></tr>
    <tr><td class="paramname">noiseLevels</td><td>Vector where the noise levels will be stored. </td></tr>
    <tr><td class="paramname">missingHarmonicFlag</td><td>Flag set to one or zero, dependent on if any strong sines are missing. </td></tr>
    <tr><td class="paramname">missingHarmonicsIndex</td><td>Vector indicating where sines are missing. </td></tr>
    <tr><td class="paramname">envelopeCompensation</td><td>Vector to store compensation values for the energies in. </td></tr>
    <tr><td class="paramname">frameInfo</td><td>Frame info struct, contains the time and frequency grid of the current frame. </td></tr>
    <tr><td class="paramname">transientInfo</td><td>Transient info. </td></tr>
    <tr><td class="paramname">freqBandTable</td><td>Frequency band tables for high-res. </td></tr>
    <tr><td class="paramname">nSfb</td><td>Number of scalefactor bands for high-res. </td></tr>
    <tr><td class="paramname">xposType</td><td>Type of transposer used in the decoder. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
